plotly::ggplotly(p = readd(Reff_region_plot), dynamicTicks = T)
plotly::ggplotly(p = readd(Reff_nat_plot), dynamicTicks = T)
do_Carte(Carte = readd(Carte),
         Situation = readd(Situation_dep),
         N = 10)

readd(input) %>%
  select(Region = region_name, dep) %>% distinct() %>%
  inner_join(y = readd(Situation_region), by = "Region") %>% 
  do_Carte(Carte = readd(Carte), N = 10)

PLOT =
  readd(Reff_region) %>%
  select(Date, Region,
         MIN = `Quantile.0.025(R)`,
         MAX = `Quantile.0.975(R)`) %>%
  tidyr::complete(Date, Region,
                  fill = list(MIN = 1, MAX = 1)) %>%
  filter(Date > lubridate::dmy(01012021)) %>%
  ggplot(mapping = aes(y = Region)) +
  geom_linerange(mapping = aes(xmin = MIN,
                               xmax = MAX)) +
  geom_vline(xintercept = 1, colour = "red")
anim =
  PLOT +
  transition_states(states = Date,
                    wrap = F,
                    state_length = 1) +
  ggtitle(label = "{closest_state}")
# gganimate::animate(plot = anim,
#                    renderer = magick_renderer(loop = T))